package com.ruoyi.web.controller.biz.hugong.openapi;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.WorkType;
import com.ruoyi.system.service.IWorkTypeService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * 【请填写功能名称】Controller
 *
 * @author ruoyi
 * @date 2024 -11-29
 */
@RestController
@RequestMapping("/openapi/workType")
public class WorkTypeOpenApi extends BaseController {
    @Autowired
    private IWorkTypeService workTypeService;

    /**
     * Gets work type list.
     *
     * @param workType the work type
     * @return the work type list
     */
    @ApiOperation("获取所有角色")
    @GetMapping("/getWorkTypeList")
    public AjaxResult getWorkTypeList(WorkType workType) {
        List<WorkType> workTypeList = workTypeService.getWorkTypeList(workType);
        return success(workTypeList);
    }


    /**
     * Gets work type dict.
     *
     * @param workTypeId the work type id
     * @return the work type dict
     */
    @GetMapping("/getWorkTypeDict/{workTypeId}")
    public AjaxResult getWorkTypeDict(@PathVariable("workTypeId") String workTypeId) {
        return success(workTypeService.getWorkTypeDict(workTypeId));
    }


}
